INCLUDE=-I. -I/usr/include/libxml2 -I/usr/local/include
LDFLAGS=-lxml2 -L/usr/local/lib -ggdb
CFLAGS=-ggdb -m32

OBJECTS=DomTree.o DomElement.o DomAttribute.o DomDataHandler.o

all: clean pdom test

%.o: %.cpp
	$(CXX) -c -o $@ $< $(INCLUDE) $(CFLAGS)

clean:
	rm -rf *.o *.so *.dylib
	
pdom: $(OBJECTS)
	$(CXX) -dynamiclib -arch i386 -o libpdom.dylib $^ $(LDFLAGS)

test: $(OBJECTS)
	$(CXX) -m32 -o test test.cpp $(LDFLAGS) $(INCLUDE) -L. -lpdom

